<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
    <script type="text/javascript">
        function back(para) {
            // window.AppInterface.back("xx");
            window.AppInterface.back(para);
        }

        function getUserId(para) {
            var r = window.AppInterface.getUserId(para);
            alert(r);
        }

        function add(p1 , p2) {
            var r = p1 + p2;
            alert(r);
        }

        function guid() {
            return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
            var r = Math.random() * 16 | 0,
            v = c == 'x' ? r : (r & 0x3 | 0x8);
            return v.toString(16);
            });
        }

    </script>
</head>
<body>
<h1 align="center">Android与JS互调示例</h1>

<h2>JS调用Android原生功能</h2>
<input type="button"
       style="width:100%; font-size: 25px"
       value="执行原生方法-模拟返回功能"
       onClick="back('这里可以传参数')"/>

<input type="button"
       style="width:100%; font-size: 25px"
       value="执行原生方法 并获取返回值"
       onClick="getUserId('js传入android参数')"/>


<hr/>

</body>
</html>